<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>39 | 一级计划创建/审批</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Modern Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript">
	
	 addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 

</script>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!-- Graph CSS -->
<link href="css/lines.css" rel='stylesheet' type='text/css' />
<link href="css/font-awesome.css" rel="stylesheet">
<!-- jQuery -->
<script src="js/jquery.min.js"></script>
<!-- Nav CSS -->
<link href="css/custom.css" rel="stylesheet">
<!-- Metis Menu Plugin JavaScript -->
<script src="js/metisMenu.min.js"></script>
<script src="js/custom.js"></script>
<!-- Graph JavaScript -->
<script src="js/d3.v3.js"></script>
<script src="js/rickshaw.js"></script>
<script type="text/javascript">
	window.onload = function() {
		var nowDate = new Date();
		var setStart = document.getElementById("setStart");
		setStart.value = nowDate.getFullYear() + "-"
				+ (nowDate.getMonth() + 1) + "-" + nowDate.getDate() + " "
				+ nowDate.getHours() + ":" + nowDate.getMinutes();
		setStartSpan.innerHTML = nowDate.getFullYear() + "年"
				+ (nowDate.getMonth() + 1) + "月" + nowDate.getDate() + "日 "
				+ nowDate.getHours() + ":" + nowDate.getMinutes();
	}
	
	function access() {
		project_id = $('#selector_1 option:selected').val();
		window.location.href="access_plan?project_id=" + project_id;
	}
	
</script>
</head>
<body>
	<div id="wrapper">
		<!-- Navigation -->
		<!-- left.jsp -->
		<jsp:include page="left.jsp"></jsp:include>
		<div id="page-wrapper">

			<div class="graphs">
				<div class="xs">
				<div class="tab-content">
					<div class="tab-pane active" id="horizontal-form">
					<c:choose>
						<c:when test="${sessionScope.user.role.id == 2}">
							<h3>一级计划创建准备</h3>
							<h4>请选择一个项目，为它创建一级计划</h4>
							<form name="add" method="post" action="createFirstplanCommit?opcode=createNode"
								class="form-horizontal">
										<div class="form-group">
											<c:choose>
												<c:when test="${projectList.size() > 0 }">
													<label for="selector1" class="col-sm-2 control-label">项目令号</label>
											<div class="col-sm-8">
												<select name="project_id" id="selector1"
													class="form-control1">
													<c:forEach items="${projectList}" var="project">
															<c:if test="${project.cpd_ps.id == sessionScope.user.id }">
																<option value="${project.id}">${project.project_code
																	}&nbsp;${project.project_name}</option>
															</c:if>
													</c:forEach>
												</select>
												<div class="form-group">
											<div class="col-sm-8">
												<input type="hidden" id="setStart" name="setStart"/>		
											</div>
										</div>
										<div class="form-group" align="center">
											<button type="submit" class="btn btn-primary" onclick="this.form.submit()">开始创建一级计划</button>
										</div>
											</div>	
												</c:when>
												<c:otherwise>
													<h4 align="center" style="color:red;">抱歉，暂时没有未创建一级计划的项目。</h4>
												</c:otherwise>
											</c:choose>
										</div>
							</form>
						</c:when>
						<c:when test="${sessionScope.user.role.id == 3}">
							<h3>一级计划审批</h3>
							<h4>请选择一个待审批的一级计划</h4>
										<div class="form-group">
											<c:choose>
												<c:when test="${projectList.size() > 0 }">
													<label for="focusedinput" class="col-sm-2 control-label">项目令号</label>
													<div class="col-sm-8">
														<select name="project_id" id="selector_1" 
															class="form-control1">
															<c:forEach items="${projectList}" var="project">
																<option value="${project.id}" 																	
																>${project.project_code
																	}&nbsp;${project.project_name}</option>
															</c:forEach>
														</select>
														<div class="form-group">
													<div class="col-sm-8">	
											</div>
										</div>
										<div class="form-group" align="center">
											<input type="submit" class="btn btn-primary"
												onclick="access()" value="审批"/>
										</div>
											</div>	
												</c:when>
												<c:otherwise>
													<h4 align="center" style="color:red;">抱歉，暂时没有待审批的一级计划。</h4>
												</c:otherwise>
											</c:choose>
									</div>
						</c:when>
					</c:choose>
					
				</div>
			</div>
		</div>
		<div class="copy_layout">
			<jsp:include page="copyright.jsp"></jsp:include>
		</div>
	</div>

	</div>
	<!-- /#page-wrapper -->
	</div>
	<!-- /#wrapper -->
	<!-- Bootstrap Core JavaScript -->
	<script src="js/bootstrap.min.js"></script>
</body>
</html>
